﻿using System;
using System.Collections.Generic;
using System.Linq;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoLEntitySideloader.Attributes;
using ProbeMod.Cards.Template;

namespace ProbeMod.Cards
{
    /// <summary>
    /// 探机W防御牌
    /// </summary>
    public sealed class ProbeBlockWDef : ProbeCardTemplate
    {
        public override CardConfig MakeConfig()
        {
            var config = GetCardDefaultConfig();

            config.Rarity = Rarity.Common;
            config.Type = CardType.Defense;
            config.TargetType = TargetType.Nobody;
            config.IsPooled = false;
            config.FindInBattle = false;
            config.Colors = new List<ManaColor>() { ManaColor.White };

            config.Keywords = Keyword.Basic;
            config.UpgradedKeywords = Keyword.Basic;

            config.Cost = new ManaGroup() { White = 1,Any = 1 };
            config.UpgradedCost = new ManaGroup() { Any = 2 };            

            config.Block = 10;
            config.UpgradedBlock = 13;

            config.Index = CardIndexGenerator.GetUniqueIndex(config);
            return config;
        }
    }

    /// <summary>
    /// 探机防御W
    /// </summary>
    [EntityLogic(typeof(ProbeBlockWDef))]
    public sealed class ProbeBlockW : ProbeCard
    {
        protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
        {
            yield return DefenseAction();
        }
    }
}
